<!DOCTYPE html>

<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>登录</title>
		<link rel="stylesheet" href="__STATIC__/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="__STATIC__/css/login.css" />
		<style>
			.err {
				width: 150px;
				height: 50px;
				background: rgba(0, 0, 0, 0.6);
				text-align: center;
				line-height: 50px;
				border-radius: 5px;
				color: white;
				position: absolute;
				z-index: 99;
				left: 50%;
				top: 50%;
				transform: translate(-50%, -50%);
				display: none;
			}
		</style>
	</head>

	<body class="beg-login-bg">
		<div class="beg-login-box">
			<header>
				<h1>后台登录</h1>
			</header>
			<div class="beg-login-main">
				<div class="err">{if condition="$err eq 1"}登录成功!{elseif condition="$err eq 2"} 登录失败!{/if}</div>
				<form action="{:url('logininfo')}" class="layui-form" method="post"><input name="__RequestVerificationToken" type="hidden" value="fkfh8D89BFqTdrE2iiSdG_L781RSRtdWOH411poVUWhxzA5MzI8es07g6KPYQh9Log-xf84pIR2RIAEkOokZL3Ee3UKmX0Jc8bW8jOdhqo81" />
					<div class="layui-form-item">
						<label class="beg-login-icon">
                        <i class="layui-icon">&#xe612;</i>
                    </label>
						<input type="text" name="userName" lay-verify="userName" autocomplete="off" placeholder="这里输入登录名" class="layui-input">
					</div>
					<div class="layui-form-item">
						<label class="beg-login-icon">
                        <i class="layui-icon">&#xe642;</i>
                    </label>
						<input type="password" name="password" lay-verify="password" autocomplete="off" placeholder="这里输入密码" class="layui-input">
					</div>
					<div class="layui-form-item">
						<div class="beg-pull-left beg-login-remember">
							<label>记住帐号？</label>
							<input type="checkbox" name="zzz" lay-skin="switch" lay-filter="switchTest" title="记住账号">
						</div>
						<div class="beg-pull-right">
							<i class="layui-icon">&#xe650;</i>
							<input type="submit" class="layui-btn layui-btn-primary" value="登录" />
						</div>
					</div>
					<div class="beg-clear"></div>
			</div>
			</form>
		</div>
		<footer>
			<p>Beginner © www.zhengjinfan.cn</p>
		</footer>
		</div>
		<script type="text/javascript" src="__STATIC__/plugins/layui/layui.js"></script>

		<script>
			layui.use(['layer', 'form'], function() {
				var layer = layui.layer,
					$ = layui.jquery,
					form = layui.form();
				form.on('switch(switchTest)', function(data) {
					if (data.elem.checked == true) {
						var name = document.querySelector(".layui-form-item input").value;
						// 保存数据到sessionStorage
						sessionStorage.setItem('name', name);
					}
				});
			});
			var stact = document.querySelector(".err").innerHTML;
			if (stact != null && stact != "") {
				document.querySelector(".err").style.display = "inline";
				setTimeout(function() {
					document.querySelector(".err").style.display = "none";
					if (stact == "登录成功!") {
						location.href = "http://118.24.83.96:80/wojuAdmin/public/admin/index/index";
					}
				}, 2000)
			}
				var var_name = sessionStorage.getItem('name');
			 document.querySelector(".layui-form-item input").value=var_name;
		</script>
	</body>

</html>